'use strict';
const path = require('path');

module.exports = appInfo => {
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1517475314617_9176';

  // add your config here
  config.middleware = [];

  // art-template 配置
  config.art = {
    root: path.join(appInfo.baseDir, 'app/view'),
    filename: null,
    escape: true,
    debug: process.env.NODE_ENV !== 'production',
    bail: true,
    cache: true,
    minimize: true,
    compileDebug: false,
    extname: '.art',
    ignore: [],
  };
  // 模板引擎配置
  config.view = {
    defaultViewEngine: 'art',
    mapping: {
      '.art': 'art',
    },
  };
  // mogodb 配置

  config.mongoose = {
    url: 'mongodb://127.0.0.1/example',
    options: {}
  };
  // redis配置

  config.redis = {
    client: {
      port: 6379,
      host: '127.0.0.1',
      password: '',
      db: 3,
    },
  };
  return config;
};

